<%@ page language="java" pageEncoding="utf-8"
		 contentType="text/html;charset=utf-8"%>
<html>

<%@ include file="../../../common/jstl.jsp"%>
<head>
</head>

<body>

<div id="addForm" class="mgt40">

	<form action="${ctx}/awardRecord/ajax/save" id="editForm" method="post">
		<input type="hidden" name="id" value="${awardRecord.id }"/>
		<div class="">
			<div class="J_formTable l_form_table">
				<table class="not_hightlight">
					<tr>
						<td class="l_title w200">奖项类型：<font color="red">*</font></td>
						<td>
							<div class="t_opacitySelect ml10">
								<select name="columnId" style="min-width:200px">
									<option value="">请选择</option>
									<c:forEach items="${awardRecordCateList }" var="c">
										<option value="${c.id }"
												<c:if test="${c.id == awardRecord.columnId }">selected</c:if>
										>${c.name }</option>
									</c:forEach>
								</select>
							</div>
						</td>
					</tr>
					<tr>
						<td class="l_title w200">作品名称：</td>
						<td>
							<div class="J_toolsBar fl" style="min-width:200px">
								<div class="t_text ml10 " style="min-width:200px">
									<label>
										<input type="text" name="name" value="${awardRecord.name }" >
									</label>
								</div>
							</div>
						</td>
					</tr>


					<tr id="orderNoTr">
						<td class="l_title w200">获奖单位：</td>
						<td>
							<div class="J_toolsBar fl" style="min-width:200px">
								<div class="t_text w200 ml10">
									<label>
										<input type="text" name="company" value="${awardRecord.company }" >
									</label>
								</div>
							</div>
						</td>
					</tr>

					<tr id="level">
						<td class="l_title w200">奖项等级：</td>
						<td>
							<div class="J_toolsBar fl" style="min-width:200px">
								<div class="t_text w200 ml10">
									<label>
										<input type="text" name="level" value="${awardRecord.level }" >
									</label>
								</div>
							</div>
						</td>
					</tr>

					<tr>
						<td class="l_title w200">获奖时间：</td>
						<td>
							<div class="J_toolsBar fl">
								<div class="w200 ml10">
									<label>
										<input placeholder="开课时间" type="text" id="awardTime" name="awardTime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" value="${awardRecord.awardTime }" style="min-width:200px" autocomplete="off">
									</label>
								</div>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
	var parentChosen;

	//表单验证
	$(function(){

		parentChosen = $(".chosen-select").chosen({
			no_results_text: "未找到父栏目",
			width : '100%'
		});

		$('#editForm').validator({
			ignore: ':hidden',
			fields : {
				code : '栏目编码:required;length[~20]',
				name : '栏目名称:required;length[~32]',
				orderNo : '序号:integer[+]',
				columnLevel : '栏目层级:required;',
				parentId : '父栏目:required;'
			},
			valid : function(form){
				var laodIdx = layer.load();

				$('#editForm').ajaxSubmit({
					data : {
					},
					traditional : true,
					success : function(result){
						layer.close(laodIdx);
						if(result.success){
							layer.alert('保存成功', function(){
								window.location.reload();
							});
						}else{
							layer.alert(result.msg);
						}
					}
				});
			}
		});






	});
</script>
</body>
</html>